<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>京硕随便印</title>
  <link rel="stylesheet" href="mobile/layui/css/layui.mobile.css">
  <link rel="stylesheet" href="mobile/layui/css/layui.css">
  <link rel="stylesheet" href="mobile/css/yj_css.css">
</head>
<body>
  <header class="yj-header">
    <a href="javascript:history.go(-1)" class="yj-header-return layui-icon">&#xe603;</a>
    <a class="yj-header-return layui-icon"></a>
    <span>优惠券</span>
    <a class="yj-header-meau"></a>
  </header>
  <div class="yj-content">

      <!-- 优惠券 -->
      </div>
    </div>
  </div>
</body>

<script th:src="@{/mobile/js/jquery.min.js}"></script>
<script th:src="@{/mobile/layui/layui.js}"></script>
<script th:inline="javascript">
  var url = [[@{/}]];
    layui.use("layer", function () {
      var layer = layui.layer;
    })
</script>

<script th:inline="javascript">
    $(function(){
      $.ajax({
        url:url+"voucher/findVouchers",
        success:function (result) {
          var conlog = "";

          for (var i =0;i<result.length;i++){
            var po = result[i];
            conlog +='<div class="yj-padding-big yj-coupon">'+
                    ' <div class="yj-bgfff yj-coupon-item yj-mar-b-big">'+
                        '<div class="yj-coupon-info yj-pad-tb yj-pad-lr-big">'+
                        '         <p class="yj-coupon-title">代金券</p>'+
            '          <p class="yj-color-gray yj-mar-tb-big yj-text-small">使用后可1:1兑换为余额</p>'+
            '              <p class="yj-color-gray yj-text-small">获得时间：<span>'+po.vTerm+'</span></p>'+
            '             </div>'+
            '              <div class="yj-coupon-right">'+
            '                       <p class="yj-colorfff yj-text-center yj-pad-t-big">&yen;<span class="yj-coupon-num">'+po.vSum+'</span></p>'+
            '              <p class="yj-text-center yj-pad-t"><button class="yj-btn yj-coupon-user-btn">使用</button></p>'+
            '             </div>'+
                    '</div> '+
            '</div> ';
          }
          $(".yj-content").html(conlog);
        }
      })

    })
</script>
</html>